/*
 * UnaryEdge.java
 *
 * Created on June 27, 2006, 1:10 PM
 *
 */

package galronnlp.pcfg.parser;

import galronnlp.util.Symbol;

/**
 * Implementation of an edge for Unary productions. It contains a single <code>
 * Symbol</code> for the RHS non-terminal.
 * <p>
 * This is based on the edges as defined in Chris Brew's python
 * Statistical CKY parser
 * @author Daniel A. Galron
 */
public class UnaryEdge extends Edge {
    
    private Symbol entry;
    
    /**
     * Creates a new instance of UnaryEdge
     */
    public UnaryEdge(Symbol e) {
        this.entry = e;
    }
    
    public int type() {
        return UNARY;
    }
    
    public Symbol entry() {
        return entry;
    }
    
    public String toString() {
        return "(" + entry + ")";
    }
    
}
